In recent years, a semiconductor device which includes a thin film transistor provided over an insulating surface has been developed. In order to manufacture such a semiconductor device, there is a technique in which a release layer is formed over a substrate, a transistor is formed over the release layer, and the release layer is removed by using an etching agent such as halogen fluoride (for example, Reference 1: Japanese Patent No. 3406727).